package entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the PARTICIPE database table.
 * 
 */
@Embeddable
public class ParticipePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="REF_IDELECTEUR")
	private int refIdelecteur;

	@Column(name="REF_IDELECTION")
	private int refIdelection;

	public ParticipePK() {
	}
	
	public ParticipePK(int refIdelecteur, int refIdelection) {
		this.refIdelecteur = refIdelecteur;
		this.refIdelection = refIdelection; 
	}
	
	public int getRefIdelecteur() {
		return this.refIdelecteur;
	}
	public void setRefIdelecteur(int refIdelecteur) {
		this.refIdelecteur = refIdelecteur;
	}
	public long getRefIdelection() {
		return this.refIdelection;
	}
	public void setRefIdelection(int refIdelection) {
		this.refIdelection = refIdelection;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ParticipePK)) {
			return false;
		}
		ParticipePK castOther = (ParticipePK)other;
		return 
			(this.refIdelecteur == castOther.refIdelecteur)
			&& (this.refIdelection == castOther.refIdelection);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.refIdelecteur ^ (this.refIdelecteur >>> 32)));
		hash = hash * prime + ((int) (this.refIdelection ^ (this.refIdelection >>> 32)));
		
		return hash;
	}
}